@model LynxWebLog.ViewModels.BlogDataView

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="form-horizontal">
        <legend>BlogData</legend>

        <div class="container">
            <div class="row">
                <div class="col-sm-2 col-md-2 col-lg-2">
                    <div class="form-group">
                        @Html.LabelFor(model => model.bd.blogid, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(model => model.bd.blogid, new { @class = "form-control input-sm", disabled = "disabled" })
                            @Html.HiddenFor(model => model.bd.blogid)
                            @Html.ValidationMessageFor(model => model.bd.blogid, null, new { @class = "help-inline" })
                        </div>
                    </div>
                </div>
                <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-3 col-md-3 col-lg-3">
                    <div class="form-group">
                        @Html.LabelFor(model => model.bd.username, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(model => model.bd.username, new { @class = "form-control input-sm", disabled = "disabled" })
                            @Html.HiddenFor(model => model.bd.username)
                            @Html.ValidationMessageFor(model => model.bd.username, null, new { @class = "help-inline" })
                        </div>
                    </div>
                </div>
                <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-5 col-md-5 col-lg-5">
                    <div class="form-group">
                        @Html.LabelFor(model => model.bd.blogname, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(model => model.bd.blogname, new { @class = "form-control input-sm", disabled = "disabled" })
                            @Html.HiddenFor(model => model.bd.blogname)
                            @Html.ValidationMessageFor(model => model.bd.blogname, null, new { @class = "help-inline" })
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-7 col-md-6 col-lg-5">
                    <div class="form-group">
                        @Html.LabelFor(model => model.bd.url, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(model => model.bd.url, new { @class = "form-control input-sm" })
                            @Html.ValidationMessageFor(model => model.bd.url, null, new { @class = "help-inline" })
                        </div>
                    </div>
                </div>
                <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-4 col-md-4 col-lg-4">
                    <div class="form-group">
                        @Html.LabelFor(model => model.bd.license, new { @class = "control-label" })
                        <div class="controls">
                            @Html.DropDownListFor(model => model.bd.license, (List<SelectListItem>)ViewBag.License, Model.bd.license, new { @class = "form-control input-sm" })
                            @Html.ValidationMessageFor(model => model.bd.license, null, new { @class = "help-inline" })
                        </div>
                    </div>
                </div>
            </div>
            @if (Convert.ToBoolean(HttpContext.Current.Application["__CommentPolicy"])) {
                <div class="row">
                    <p>Comments are not allowed by site policy</p>
                </div>
            } else {
                @Html.HiddenFor(model => model.cp.blogid)
                <div class="form-group">
                    <div class="checkbox">
                        @Html.CheckBoxFor(model => model.cp.pagecommentsallowed)
                        @Html.LabelFor(model => model.cp.pagecommentsallowed, new { @class = "control-label" })
                        @Html.ValidationMessageFor(model => model.cp.pagecommentsallowed, null, new { @class = "help-inline" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="checkbox">
                        @Html.CheckBoxFor(model => model.cp.blogcommentsallowed)
                        @Html.LabelFor(model => model.cp.blogcommentsallowed, new { @class = "control-label" })
                        @Html.ValidationMessageFor(model => model.cp.blogcommentsallowed, null, new { @class = "help-inline" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="checkbox">
                        @Html.CheckBoxFor(model => model.cp.ismoderated)
                        @Html.LabelFor(model => model.cp.ismoderated, new { @class = "control-label" })
                        @Html.ValidationMessageFor(model => model.cp.ismoderated, null, new { @class = "help-inline" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="checkbox">
                        @Html.CheckBoxFor(model => model.cp.requirescaptcha)
                        @Html.LabelFor(model => model.cp.requirescaptcha, new { @class = "control-label" })
                        @Html.ValidationMessageFor(model => model.cp.requirescaptcha, null, new { @class = "help-inline" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="checkbox">
                        @Html.CheckBoxFor(model => model.cp.showuserlink)
                        @Html.LabelFor(model => model.cp.showuserlink, new { @class = "control-label" })
                        @Html.ValidationMessageFor(model => model.cp.showuserlink, null, new { @class = "help-inline" })
                    </div>
                </div>
            }
        </div>
        <div class="form-actions">
            <input type="submit" value="Save" class="btn btn-default btn-primary" />
        </div>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

